    		<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        	<p class="pull-left" style="font-size:16px; line-height:30px;"><strong><?php echo $this->translate('库存状态管理'); ?></strong></p>
        	<p class="pull-right">
            <a href="<?php echo $this->url('stock_state/default',array('action'=>'add')); ?>" class="btn btn-small btn-primary"><i class="icon-plus icon-white"></i> <?php echo $this->translate('添加库存状态'); ?></a>&nbsp;
            <a href="<?php echo $this->myviewalias()->dbshopHelpUrl('state_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
            </p>
        	</div>
            <table class="table table-hover">
            <thead style="background:#CCC;">
            	<tr>
                    <th width="5%">ID</th>
                    <th width="30%"><?php echo $this->translate('库存状态名称'); ?></th>
                    <th width="10%"><?php echo $this->translate('库存状态类型'); ?></th>
                    <th width="10%"><?php echo $this->translate('库存状态排序'); ?></th>
                    <th width="8%"><?php echo $this->translate('操作'); ?></th>
                </tr>
            </thead>
            <?php if($this->state_array) foreach ($this->state_array as $state_value) { ?>            
            <tr>
            	<td><?php echo $state_value['stock_state_id']; ?></td>
            	<td><?php echo $this->escapeHtml($state_value['stock_state_name']); if ($state_value['state_type'] == 1) echo '&nbsp;&nbsp;('.sprintf($this->translate('%s默认%s'),'<strong>','</strong>').')'; ?></td>
                <td><?php echo ($state_value['stock_type_state'] == 1 ? $this->translate('有货状态') : $this->translate('无货状态')); ?></td>
                <td><?php echo $state_value['state_sort']; ?></td>
            	<td><a href="<?php echo $this->url('stock_state/default',array('action'=>'edit','stock_state_id'=>$state_value['stock_state_id'])); ?>"><?php echo $this->translate('编辑'); ?></a><span><?php if ($state_value['state_type'] != 1) { ?>|</span><a href="javascript:;" onclick="return stock_state_del_js(<?php echo $state_value['stock_state_id']; ?>);"><?php echo $this->translate('删除'); ?></a><?php } ?></td>  
            </tr>
            <?php
				}
			?>
            </table>
            
<script>
//库存状态删除js
function stock_state_del_js(stock_state_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该库存状态吗？'); ?>')) {
	$.post("<?php echo $this->url('stock_state/default',array('action'=>'del')); ?>",{stock_state_id:stock_state_id},
	function(data){
		if(data != 'false') {
			if(data == 'goods_exists') {
				alert('<?php echo $this->translate('该库存状态在商品中已经使用，不能删除！'); ?>');
				return false;	
			}
			
			window.location.href='<?php echo $this->url('stock_state/default'); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('库存状态删除失败！'); ?>');
		}
	});
	}
	return false;
}
</script>